home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / 4dtnt.zip / HMENU.DOC < prev    next >
Text File  |  1991-11-03  |  7KB  |  296 lines

  1.    This is a real menu setup for a command-line illiterate user who couldn't
  2.    do anything with 4DOS (or command.com) unassisted.  The most interesting
  3.    part is the prompting for f7 (copy a file) and some of the other functions.
  4.  
  5. cd d:\
  6. cd c:\
  7.  
  8.    The following two variables will position a highlighted "@" sign to 
  9.    show what was chosen last.  For now, nothing has been chosen before.
  10.  
  11. set lastx=0
  12. set lasty=0
  13.    
  14.    Draw the menu
  15.  
  16. :start
  17.  unset thingie tofile fromfile wtf
  18.  cls
  19.  drawbox 0 0 24 79 2 white on blue fill blue
  20.  scrput 2  8 white on blue --------- Function Keys ------   ------ Shift Function Keys ------
  21.  scrput 3  8 white on blue f1  Kings                        *f1  Gomoku
  22.  scrput 5  8 white on blue f2  Show document directory      *f2  Communications
  23.  scrput 7  8 white on blue f3  Manual command               *f3  First Publisher
  24.  scrput 9  8 white on blue f4  Edit a document              *f4  Shooting gallery
  25.  scrput 11 8 white on blue f5  Mahjongg                     *f5  Breakout
  26.  scrput 13 8 white on blue f6  Solitare                     *f6  Reset Trackball
  27.  scrput 15 8 white on blue f7  Copy a file                  *f7  DB3+
  28.  scrput 17 8 white on blue f8  Envelope on Daisy Wheel      *f8  Epson printer page eject
  29.  scrput 19 8 white on blue f9  Epson printer reset          *f9  Super Fly
  30.  scrput 21 8 white on blue f10 DOS Environment              *f10 Shut down system
  31.  iff "%lastx%" ne "0" then^scrput %lasty% %lastx% bright white on blue @^endiff
  32. rem drawvline 0 39 25 1 white on blue
  33.  
  34.    Wait for an input key, updating the time every second while waiting.
  35.  
  36. :timeloop
  37.  
  38.    Allow for the fact that inkey moves the cursor on a timeout.
  39.  screen 0 0
  40.   
  41.  scrput 1 30 white on blue %_date   %_time
  42.  inkey /w1 %%WTF 
  43.  if "%WTF%" == "" goto timeloop
  44.  
  45.  Got a keystroke -- figure out what it was, if anything.
  46.  
  47. rem
  48. if %WTF% == @59 goto dof1
  49. if %WTF% == @60 goto dof2
  50. if %WTF% == @61 goto dof3 
  51. if %WTF% == @62 goto dof4
  52. if %WTF% == @63 goto dof5
  53. if %WTF% == @64 goto dof6
  54. if %WTF% == @65 goto dof7
  55. if %WTF% == @66 goto dof8
  56. if %WTF% == @67 goto dof9
  57. if %WTF% == @68 goto dof10
  58. if %WTF% == @84 goto doshf1
  59. if %WTF% == @85 goto doshf2
  60. if %WTF% == @86 goto doshf3
  61. if %WTF% == @87 goto doshf4
  62. if %WTF% == @88 goto doshf5
  63. if %WTF% == @89 goto doshf6
  64. if %WTF% == @90 goto doshf7
  65. if %WTF% == @91 goto doshf8
  66. if %WTF% == @92 goto doshf9
  67. if %WTF% == @93 goto doshf10
  68. if %WTF% == @113 goto doshf10
  69. rem
  70.  
  71.   Unrecognized keystroke -- ignore.
  72. goto start
  73.  
  74.   A typical case limb for a function key, repeated many times here.
  75.  
  76. :dof1
  77.  
  78.   Position the "@" sign for return to menu
  79.  
  80.  set lastx=11
  81.  set lasty=3
  82.  
  83.  c:\games\kings
  84.  goto start
  85.  
  86.  
  87.  
  88. :dof2
  89.  cls
  90.  dir /4apv c:\foo\*.*
  91.  pause
  92.  set lastx=11
  93.  set lasty=5
  94.  goto start
  95.  
  96.  
  97.   A function which requires further prompting:
  98.  
  99. :dof3
  100.  
  101.   Put up the prompt just below the menu pick.
  102.  scrput 2 27 bright yel on blue "?" will abort the command
  103.  
  104.   Put up the prompt wording
  105.  scrput 8 8 white on blue Command:
  106.  
  107.   Put up a field of blanks to fill in
  108.  scrput 8 16 bright yellow on blue _____________________________________________________________
  109.  
  110.   Position the cursor to the start of the blanks
  111.  screen 8 16
  112.  
  113.   Get the prompt fill from user
  114.  input %%thingie
  115.  cls
  116.  
  117.   Check for an abort signal.
  118.  if "%thingie%" == "?" goto start
  119.  
  120.  set lastx=11
  121.  set lasty=7
  122.  %thingie%
  123.  pause
  124.  goto start
  125.  
  126.  
  127. :dof4
  128.  scrput 2 27 bright yel on blue "?" will abort the command
  129.  scrput 10 8 white on blue Document name:
  130.  scrput 10 22 bright yellow on blue ____________
  131.  screen 10 22
  132.  input %%thingie
  133.  if "%thingie%" == "?" goto start
  134.  set lastx=11
  135.  set lasty=9
  136.  cls
  137.  rem call hdb %thingie%
  138.  ws c:\budnick\%thingie%
  139.  fr
  140.  goto start
  141.  
  142.  
  143. :dof5
  144.  scrput 12 8 white on blue Board number:
  145.  scrput 12 21 bright yellow on blue ______
  146.  screen 12 21
  147.  input %%thingie
  148.  set lastx=11
  149.  set lasty=11
  150.  iff "%thingie%" == "" then^c:\games\mahjongg -y -f -m -n^
  151.           else^c:\games\mahjongg -y -f -m -n -b%thingie%^endiff
  152.  goto start
  153.  
  154.  
  155. :dof6
  156.  keystack "NNS1Hanny" 13 "YYY" 0 0 "x"^c:\games\solitare
  157.  set lastx=11
  158.  set lasty=13
  159.  goto start
  160.  
  161.  
  162.  
  163.    This one is unusual in that it requires TWO prompts -- one for the
  164.    input file, one for the output file.
  165.  
  166. :dof7
  167.  
  168.    Put up the input prompt just below the menu pick, including a field of
  169.    bright yellow blanks and position the cursor to the start of the field.
  170.  scrput 2 27 bright yel on blue "?" will abort the command
  171.  scrput 16 8 white on blue Copy from:
  172.  scrput 16 18 bright yellow on blue ___________________________________________________
  173.  screen 16 18
  174.  
  175.    Get the input string
  176.  input %%fromfile
  177.  
  178.    Make sure the input file exists or prompt again for input file.
  179.  if "%fromfile%" == "" goto dof7
  180.  if "%fromfile%" == "?" goto start
  181.  if not exist %fromfile% goto dof7
  182.  
  183.    Prompt for the output file.
  184. :doof7
  185.  scrput 16 8 white on blue Copy to:
  186.  scrput 16 16 bright yellow on blue ____________________________________________________
  187.  screen 16 16
  188.  input %%tofile
  189.  
  190.    Check the response
  191.  if "%tofile%" == "?" goto start
  192.  if "%tofile%" == "" goto doof7
  193.  set lastx=11
  194.  set lasty=15
  195.  cls
  196.  copy %fromfile% %tofile%
  197.  pause
  198.  goto start
  199.  
  200.  
  201. :dof8
  202.  scrput 2 27 bright yel on blue "?" will abort the command
  203.  scrput 18 8 white on blue Document name:
  204.  scrput 18 22 bright yellow on blue ____________
  205.  screen 18 22 
  206.  input %%thingie
  207.  if "%thingie%" == "" goto dof8
  208.  if "%thingie%" == "?" goto start
  209.  if not exist c:\budnick\%thingie% goto dof8
  210.  set lastx=11
  211.  set lasty=17
  212.  envelope c:\budnick\%thingie% /c > com2
  213.  goto start
  214.  
  215. :dof9
  216.  pinit
  217.  set lastx=11
  218.  set lasty=19
  219.  goto start
  220.  
  221.    Exit to DOS pick.
  222. :dof10
  223.  unset wtf
  224.  cls
  225.  echo type HMENU at any DOS prompt to return to the main menu
  226.  quit
  227.  
  228. :doshf1
  229.  set lastx=45
  230.  set lasty=3
  231.  c:\games\gomoku
  232.  goto start
  233.  
  234. :doshf2
  235.  cls
  236.  call tc
  237.  set lastx=45
  238.  set lasty=5
  239.  goto start
  240.  
  241. :doshf3
  242.  e:
  243.  cd e:\pub
  244.  fp
  245.  cd e:\
  246.  c:
  247.  colset 17 50 5a 03
  248.  set lastx=45
  249.  set lasty=7
  250.  goto start
  251.  
  252. :doshf4
  253.  to c:\games^shoot^fr
  254.  set lastx=45
  255.  set lasty=9
  256.  goto start
  257.  
  258. :doshf5
  259.  c:\games\breakout S-6
  260.  set lastx=45
  261.  set lasty=11
  262.  goto start
  263.  
  264. :doshf6
  265.  trakball dos
  266.  set lastx=45
  267.  set lasty=13
  268.  goto start
  269.  
  270. :doshf7
  271.  trakball dbase^to db3^dbase^fr
  272.  set lastx=45
  273.  set lasty=15
  274.  goto start
  275.  
  276. :doshf8
  277.  pff
  278.  set lastx=45
  279.  set lasty=17
  280.  goto start
  281.  
  282. :doshf9
  283.  pushd c:\games
  284.  fly
  285.  popd
  286.  set lastx=45
  287.  set lasty=19
  288.  goto start
  289.  
  290.  
  291.    Call alias to purge and disable disk cache.
  292. :doshf10
  293.  cls
  294.  sysdown
  295.  quit
  296.